<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            color: red;
            border: 2px solid purple;
        }

        .box p{
            /* 该属性不具备继承性，但是可以如下强制继承 */
            border: inherit;
        }
    </style>
</head>
<body>
    <div class="box">
        <p>我是p元素</p>
        <h1>我是h1元素</h1>
    </div>
</body>
</html>